package com.platform.api;

import com.platform.entity.PickupVo;
import com.platform.entity.PointEntityVo;
import com.platform.service.ApiPickupService;
import com.platform.util.ApiBaseAction;
import com.platform.util.CoordinateUtil;
import com.vividsolutions.jts.geom.Coordinate;
import com.vividsolutions.jts.geom.GeometryFactory;
import com.vividsolutions.jts.geom.Point;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

@Api(tags = "地图")
@RestController
@RequestMapping("/api/pickup")
public class ApiPickupController extends ApiBaseAction {

    @Autowired
    ApiPickupService apiPickupService;

    @ApiOperation(value = "根据用户经纬度，获取取货点信息",response = Map.class)
    @PostMapping("/pickupList")
    public Object pickupList(@RequestParam("latitude") String latitude,
                             @RequestParam("longitude") String longitude){
        List<PickupVo> pickupVos = apiPickupService.getPickupList(latitude,longitude);
        return toResponsSuccess(pickupVos);
    }
}
